#ifndef UTILS_H
#define UTILS_H

#include <vector>
#include <string>

#include <inttypes.h>

namespace usnet {

uint32_t ReverseBits(uint32_t num);
uint64_t ReverseBits(uint64_t num);

std::string StringTrimHead(const std::string& str);
std::string StringTrimTail(const std::string& str);
inline std::string StringTrim(const std::string& str)
{
    return StringTrimHead(StringTrimTail(str));
}
std::vector<std::string> StringSplit(std::string str, const std::string& delimiter = " ");

void EthAddr2Num(uint8_t* ethaddr, const char* str);

int ByteCompare(const uint8_t* array1, const uint8_t* array2, const std::size_t len);

} // end of namespace usnet
#endif